package com.vpx;

import java.io.ByteArrayOutputStream;

/**
 * @author Dmitry
 */
public class JniVpx {

    public static native void init(int width, int height);

    public static native void loadVpxLib(String vpxLibPath);

    public static native void createEncoder(VpxEncoder encoder);

    public static native void createDecoder(VpxDecoder decoder);

    public static native boolean decodeFrame(VpxDecoder decoder, byte[] encodedFrame, long address);

    public static native void encodeFrame(long address, VpxEncoder codec, ByteArrayOutputStream stream);

    public static native byte[] convertImageToYuv(long address, int width, int height);

    public static native void convertYuvToImage(long address, int width, int height, byte[] yuvArray);

    public static native void destroyEncoder(VpxEncoder codec);
    public static native void destroyDecoder(VpxDecoder codec);
    //public static native void close();

}
